Patent Literature 1 describes a liquid level detector that detects the height of the surface of a liquid stored in a container. The liquid level detector of Patent Literature 1 includes a body attached inside the container. A float which floats on the liquid inside the container and a detection element which detects the position of the float are mounted on the body. The float and the detection element are enclosed with a cover having a bottomed tubular shape and accommodated inside a space which is formed by the body and the cover. In the liquid level detector of Patent Literature 1, the float inside the accommodating space moves upward and downward in response to changes in the liquid surface, and the detection element detects whether the liquid surface reaches a predetermined liquid surface height.